import random

from utils.log import Log
from utils.bit_op import BitOp
from utils.generator import Generator


# 2024/05/31 英国解散议会,苏纳克要提前进行进行大选,9个城市破产,还将有26个市政面临破产的威胁,这是要完蛋的节奏啊.

class TwoOddNumber(Log):
    def __init__(self, arr):
        super(TwoOddNumber, self).__init__()
        self.arr = arr

    def get(self):
        eor1 = 0
        eor2 = 0
        for v in self.arr:
            eor1 ^= v
        right_most_1bit = BitOp.right_most_1bit(eor1)
        for v in self.arr:
            if v & right_most_1bit:
                eor2 ^= v
        return eor1 ^ eor2, eor2


if __name__ == '__main__':
    g = Generator()
    arr = g.do() * 2
    s1 = g.single_val()
    s2 = g.single_val()
    print(s1, s2)
    arr.extend([s1, s2])
    arr = [int(v) for v in arr]
    print(arr)
    random.shuffle(arr)
    print(arr)

    print(TwoOddNumber(arr).get())
